<template>
  <div>
    <el-pagination v-model:currentPage="goods.goodsQuery.pagenum" v-model:page-size="goods.goodsQuery.pagesize"
      :page-sizes="[1, 5, 10, 20, 30, 50]" :small="false" :disabled="false" :background="true"
      layout="total, sizes, prev, pager, next, jumper" :total="goods.total" @size-change="handleSizeChange"
      @current-change="handleCurrentChange" />
  </div>
</template>

<script setup>
import useStore from '@/pinia/index.js';
const { goods } = useStore();

// newPage:当前页码,自带参数
function handleCurrentChange(newPage) {
  goods.REQUEST_goodsList();
  console.log('当前页面改变', newPage);
}

// newSize:当前页要显示的条数,自带参数
function handleSizeChange(newSize) {
  goods.REQUEST_goodsList();
  console.log("显示条数改变", newSize);
}
</script>

<style scoped>
</style>